<!DOCTYPE html>
<html>
<head>
    <meta charset='UTF-8'>
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <h2>欢迎{{name}}</h2>
        <!-- <button v-on:click="showInfo">点击</button> -->
        <button @click="showInfo">点击(不传参)</button>
        <button @click="showInfo2($event,9)">点击(传参)</button>
    </div>
</body>
<!--   JS   -->
    <script>
        new Vue({
            el:'#root',
            data:{
                name:'琦琦'
            },
            methods:{
                showInfo(event){
                    alert('晚上好')
                },
                showInfo2(event,number){
                    console.log(event,number)
                }
            }
        })
    </script>
</html>